
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:icecore="http://www.icefaces.org/icefaces/core" xmlns:ui="http://java.sun.com/jsf/facelets">
    
     
	<ui:composition template="../../WEB-INF/templates/template.xhtml">


		<ui:param name="title" value="Fact Entry System"/>
        	
		<ui:define name="header">
			<ui:include src="../../WEB-INF/templates/header.xhtml"/> 
		</ui:define>
		
		<ui:define name="menu">		
			<ui:include src="../../WEB-INF/templates/menuLeft.xhtml"/>               
		</ui:define>
		
		<ui:define name="content">
			
			<style type="text/css">
			               
			.icePnlGrdFtr {
			    padding-left: 120px;
			    padding-top: 60px;
			}
							
            </style>
<script type="text/javascript">

</script>	
            
			<h:panelGrid styleClass="managementHeaderTable" width="100%" columns="1" cellspacing="3" cellpadding="3">
            	<h:outputText value="Responsibility Management" />                           
            </h:panelGrid> 
            <h:messages  globalOnly="true"  style="color:green"/>
		  
			<h:dataTable value="#{responsibilityBean.respList}" styleClass="resDataTable" rowClasses="whitebg,graybg" headerClass="resHeader" var="responsibilityList"  width="800px" columnClasses="resUser,resName,resMM,resEdit">
		   		<h:column>
		       		<f:facet name="header">
		         		<div style="float: left;">
			  				<h:outputText value="User Name"/>
			  			</div>
		    </f:facet>
		       <h:outputText  value="#{responsibilityList.userName}" />
		   </h:column>
		<h:column>
		    <f:facet name="header" >
		    <div style="float: left;">
			  <h:outputText value="Role"/>
			  </div>
		    </f:facet>
		       <h:outputText  value="#{responsibilityList.roleName}" />
		   </h:column>
		   <h:column>
		       <f:facet name="header" >
		       <div style="float: left;">
			  <h:outputText value="Make-Market"/>
			  </div>
		    </f:facet>
		       <h:dataTable value="#{responsibilityList.makeMarketList}" var="makeMarketList" width="400px" columnWidths="resMake,resMarket,resDelete">
		           <h:column>
		        <h:outputText  value="#{makeMarketList.makeName}" />
		           </h:column>
		           <h:column>
		               <h:outputText  value="#{makeMarketList.marketName}" />
		           </h:column>
		         
		       </h:dataTable>
		   </h:column>
		   <h:column>
		       <f:facet name="header" >
		       <h:outputText value="Edit"/>
		       </f:facet>
		   
					 <h:commandButton value="Edit"  actionListener="#{responsibilityBean.openEditEvent}">
					     <f:param  name="userId" value="#{responsibilityList.userId}" />
					 </h:commandButton>
		
		</h:column>
	</h:dataTable>
	            
        
            
            <ice:panelPopup visible="#{responsibilityBean.editOpened}"
                            rendered="true"
                            modal="true"
                            autoCentre="true" style="width: 500px; height: 375px;  background: #FFFFFF;">    
                <f:facet name="header">
                    <h:panelGroup>
                        <h:panelGroup style="float: left;padding-left:10px;">
                            User's Make-Market Management
                        </h:panelGroup>
                        <h:panelGroup style="float: right;">
                            <h:commandButton image="/FACTENTRY/javax.faces.resource/popup-close.png.jsf?ln=images"
                                             alt="Close" title="Close"      type="button"                    
                                             style="height: 11px; width: 11px; border: 0;"
                                             actionListener="#{responsibilityBean.closeEvent}"  />
                        </h:panelGroup>
                    </h:panelGroup>
                </f:facet>
                <f:facet name="body">
                
                	<ice:panelGrid id="editRoleContent"
                       width="100%" cellpadding="0"
                       cellspacing="4" columns="2" rendered="true"
                       styleClass="popupModalBody" columnWidths="20px,400px"> 
                       
	 				   <h:outputText value="Name"/>
            		   <h:outputText   value="#{responsibilityBean.editUser.userName}" />
	 				   <h:inputHidden  value="#{responsibilityBean.editUser.userId}" id="userId" />
	 				   <h:message for="userId" style="color:red"/>
	 				   
	 				   <h:outputText value="Role"/>
            		   <h:outputText value="#{responsibilityBean.editUser.userRoleName}" />
	 				   <h:inputHidden  value="#{responsibilityBean.editUser.userRoleId}" id="roleId" />
	 				   <h:message for="roleId" style="color:red"/>
	 				   
					   
					   <h:outputText value="Make"/>
            		   <h:selectManyListbox value="#{responsibilityBean.assignedMakeList}"  size="5" id="makeId" style="width: 100px;">
				   			<f:selectItems value="#{responsibilityBean.allMakeList}" var="make"
   										itemLabel="#{make.makeName}" itemValue="#{make.makeId}" />
				   		</h:selectManyListbox>
            		            		   
					   <h:outputText value="" />
            		   <h:message for="makeId" style="color:red"/>
					   	
					   <h:outputText value="Market"/>
            		   <h:selectManyListbox value="#{responsibilityBean.assignedMarketList}" size="5" id="marketId" style="width: 100px;">
				   			<f:selectItems value="#{responsibilityBean.allMarketList}" var="market"
   								itemLabel="#{market.marketName}" itemValue="#{market.marketId}" />
				   		</h:selectManyListbox>
            		    
            		   <h:outputText value="" />
            		   <h:message for="marketId" style="color:red"/>
            		   
            		   <f:facet name="footer">
							
							<h:commandButton id="cancelButton"  actionListener="#{responsibilityBean.closeEvent}"  value="Cancel" style="width:100px;height:30px;" />
							<h:outputText value="&#160;&#160;&#160;&#160;" escape="false" />
							<h:commandButton id="saveButton"  actionListener="#{responsibilityBean.addResponsibility}"  value="Save" style="width:100px;height:30px;" />
								                 
					   </f:facet>
                    
        			</ice:panelGrid>
                   
                </f:facet>
                
            </ice:panelPopup>
            <h:inputHidden  value="#{userBean.editUser.userId}"  id="editUserId"  />	
            
         </ui:define>
		
		<ui:define name="footer">
	       <ui:include src="../../WEB-INF/templates/footer.xhtml"/> 
		</ui:define>
		
	</ui:composition>

</html>
